package com.xpu.stock.controller;

import com.xpu.stock.service.UserService;
import com.xpu.stock.vo.req.LoginReqVo;
import com.xpu.stock.vo.resp.LoginRespVo;
import com.xpu.stock.vo.resp.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public Result<LoginRespVo> login(@RequestBody LoginReqVo vo) {
        return userService.login(vo);
    }
    @GetMapping("/captcha")
    public Result<Map> genCaptchaCode(){
        return userService.genCaptchaCode();
    }

}
